翻訳と辞書
Words near each other
・ Incline railways at Niagara Falls
・ Incline Village, Nevada
・ Incline, California
・ Inclined orbit
・ Inclined plane
・ Inclined plane (disambiguation)
・ Inclined Plane Bridge
・ Inclined rig
・ Inclined tower
・ Inclining test
・ Inclinometer
・ Inclosure Act 1773
・ Inclosure Acts
・ Include (horse)
・ Include directive
Include guard
・ Include Me Out
・ Included angle
・ Inclusio
・ Inclusion
・ Inclusion (Boolean algebra)
・ Inclusion (disability rights)
・ Inclusion (education)
・ Inclusion (logic)
・ Inclusion (mineral)
・ Inclusion (taxonomy)
・ Inclusion (value and practice)
・ Inclusion and Democracy
・ Inclusion and exclusion criteria
・ Inclusion bodies


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Include guard : ウィキペディア英語版
Include guard

In the C and C++ programming languages, an #include guard, sometimes called a macro guard, is a particular construct used to avoid the problem of ''double inclusion'' when dealing with the include directive. The addition of #include guards to a header file is one way to make that file idempotent.
==Double inclusion==
The following C code demonstrates a real problem that can arise if #include guards are missing:
;File "grandfather.h"

struct foo ;

;File "father.h"

#include "grandfather.h"

;File "child.c"

#include "grandfather.h"
#include "father.h"

Here, the file "child.c" has indirectly included two copies of the text in the header file "grandfather.h". This causes a compilation error, since the structure type foo will thus be defined twice. In C++, this would be a violation of the One Definition Rule.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Include guard」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.